import Layout from '@/layout'
// 常量路由
export const constantRoutes = [
    //登录页面
    {
        path: '/login',
        component: () => import('@/views/login/index'),
        hidden: true//标识不显示到菜单导航中
    },
    //404页面
    {
        path: '/404',
        component: () => import('@/views/404'),
        hidden: true
    },
    //首页
    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        children: [{
            path: 'dashboard',
            name: 'Dashboard',
            component: () => import('@/views/dashboard/index'),
            meta: { title: '首页', icon: 'dashboard' }
        }]
    },
]
// 异步路由
export const allAsyncRoutes = [
    
    // 权限管理 start
    {
        name: 'Acl',
        path: '/acl',
        component: Layout,
        redirect: '/acl/user/list',
        meta: {
            title: '权限管理',
            icon: 'el-icon-lock'
        },
        children: [
            {
                name: 'User',
                path: 'user/list',
                component: () => import('@/views/acl/user/list'),
                meta: {
                    title: '用户管理',
                },
            },
            {
                name: 'Role',
                path: 'role/list',
                component: () => import('@/views/acl/role/list'),
                meta: {
                    title: '角色管理',
                },
            },
            {
                name: 'RoleAuth',
                path: 'role/auth/:id',
                component: () => import('@/views/acl/role/roleAuth'),
                meta: {
                    activeMenu: '/acl/role/list',
                    title: '角色授权',
                },
                hidden: true,
            },
            {
                name: 'Permission',
                path: 'permission/list',
                component: () => import('@/views/acl/permission/list'),
                meta: {
                    title: '菜单管理',
                },
            },
        ]
    },

    //商品管理
    {
        name: 'Product',//标识名称
        path: '/product',//路由路径
        component: Layout,
        redirect: '/product/trademark/list',//自动重定向到品牌管理
        meta: {
            title: '商品管理',//一级菜单名称
            icon: 'el-icon-s-goods'//图标
        },
        // 配置子路由
        children: [
            {
                name: 'Trademark',//标识名称
                path: 'trademark/list',//路由路径
                // 路径
                component: () => import('@/views/product/trademark/list'),
                meta: {
                    title: '品牌管理'
                }
            },
            {
                name: 'Attr',
                path: 'attr/list',
                component: () => import('@/views/product/attr/list'),
                meta: {
                    title: '平台属性管理',
                },
            },
        ]
    },
]
// 通配路由
export const anyRoute = { path: '*', redirect: '/404', hidden: true }
